package inabit.inabitcompiler.parser;

import inabit.fuzzy.data.FuzzySet;

import java.util.HashMap;
import java.util.Map;

/**@author Rafael Rocha*/
public class FuzzyMap {
	private static FuzzyMap instance;
	private Map<String, FuzzySet> fuzzyMap;
	
	
	private FuzzyMap() {
		fuzzyMap = new HashMap<String, FuzzySet>();
	}
	
	public static FuzzyMap getInstance() {
		if(instance == null) {
			instance = new FuzzyMap();
		}
		return instance;
	}
	public FuzzySet getFuzzySet(String id) {
		return fuzzyMap.get(id);
	}
	public void addFuzzySet(FuzzySet fuzzySet) {
		String key = fuzzySet.getName();
		this.fuzzyMap.put(key, fuzzySet);
	}
}
